package com.example.swagger.mapper;

import com.example.swagger.entity.BookEntity;
import com.example.swagger.entity.Department;
import com.example.swagger.entity.Order;
import org.apache.ibatis.annotations.*;

import java.util.Date;
import java.util.List;

/**
 * 部门mapper
 */
@Mapper
public interface DepartmentMapper {


    @Select("SELECT * FROM t_department")
    public List<Department> getDepartments();

    @Insert("INSERT INTO t_department(id, departmentName) VALUES (#{id},#{departmentName})")
    void insertDepartment(@Param("id") Integer id, @Param("departmentName") String departmentName);

    @Select("SELECT * FROM t_department WHERE id=#{id}")
    public Department getDepartmentById(Integer id);

    @Delete("DELETE FROM t_department WHERE id = ${id}")
    void deleteDepartmentById(@Param("id") Integer id);

}
